# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo do
  @moduledoc """
  A Search Ads 360 responsive search ad.

  ## Attributes

  *   `adTrackingId` (*type:* `String.t`, *default:* `nil`) - The tracking id of the ad.
  *   `descriptions` (*type:* `list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdTextAsset.t)`, *default:* `nil`) - List of text assets for descriptions. When the ad serves the descriptions will be selected from this list.
  *   `headlines` (*type:* `list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdTextAsset.t)`, *default:* `nil`) - List of text assets for headlines. When the ad serves the headlines will be selected from this list.
  *   `path1` (*type:* `String.t`, *default:* `nil`) - Text appended to the auto-generated visible URL with a delimiter.
  *   `path2` (*type:* `String.t`, *default:* `nil`) - Text appended to path1 with a delimiter.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adTrackingId => String.t() | nil,
          :descriptions =>
            list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdTextAsset.t())
            | nil,
          :headlines =>
            list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdTextAsset.t())
            | nil,
          :path1 => String.t() | nil,
          :path2 => String.t() | nil
        }

  field(:adTrackingId)

  field(:descriptions,
    as: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdTextAsset,
    type: :list
  )

  field(:headlines,
    as: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdTextAsset,
    type: :list
  )

  field(:path1)
  field(:path2)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
